import java.util.Arrays;
import java.util.Comparator;

class Student {
    public String name;
    public int score;

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }
}
class ScoreSort implements Comparator<Student> {
    @Override
    public int compare(Student o1, Student o2) {
        return o1.score - o2.score;
    }
}
public class Test {
    public static void main(String[] args) {
        ScoreSort scoreSort = new ScoreSort();
        Student[] students = new Student[3];
        students[0] = new Student("张三",45);
        students[1] = new Student("张三",67);
        students[2] = new Student("张三",23);
        Arrays.sort(students,scoreSort);
        System.out.println(Arrays.toString(students));
    }
}